package 第2节数组;

import java.util.Arrays;

public class TwoDArrayDemo {
    public static void main(String[] args) {
        int[][] matrix1 = {
                {1,2,3},
                {4,5},
                {7}
        };
        System.out.println(matrix1.length); // 3
        System.out.println(Arrays.toString(matrix1[1]));
        for (int row = 0; row < matrix1.length; row++) {
            System.out.println(Arrays.toString(matrix1[row]));
        }
        for (int row = 0; row < matrix1.length; row++) {
            for (int col = 0; col < matrix1[row].length; col++) {
                System.out.print(matrix1[row][col] + " ");
            }
            System.out.println();
        }
    }
}
